package data

import (
	"encoding/json"
	"log"
)

func ParseJSON(data string) map[string]interface{} {
	var result map[string]interface{}
	err := json.Unmarshal([]byte(data), &result)
	if err != nil {
		log.Println("JSON Parsing Error:", err)
		return nil
	}
	return result
}

func CreateJSON(data map[string]interface{}) string {
	jsonData, err := json.Marshal(data)
	if err != nil {
		log.Println("JSON Creation Error:", err)
		return ""
	}
	return string(jsonData)
}
